switchroot: Fix building with musl libc
authorWilliam Manley <will@williammanley.net>
Tue, 26 Jul 2016 16:42:17 +0000 (17:42 +0100)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 30 Aug 2016 20:50:33 +0000 (20:50 +0000)
commitfaee3df8ae244896f531ab7ad00c8ea75f148da3
tree5ef6b9a6774c989647c8c5fb0980e25d1e8c5056
parenta269075724dda958bb66e19f0d4ec3f5e52d97ba
switchroot: Fix building with musl libc

POSIX and GNU define conflicting versions of `strerror_r`.  The GNU
version returns the string but doesn't necessilary write into buf.
The POSIX version writes into buf and returns the length but doesn't
necessilary append a terminate the string with a NUL if it's too long
to fit in buf.

This commit fixes building ostree-prepare-root with musl libc.  The
stripped static build with musl on my machine is 30K vs. 724K with glibc
static and 11K with glibc shared.

Closes: #477
Approved by: cgwalters
src/switchroot/ostree-mount-util.c